<%@page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="form.ManageHome"%>
<%@page import="java.util.List"%>
<%@page import="dto.ManagerDictDTO"%>
<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

<portlet:defineObjects />
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<link href="css/fluid.css" media="screen" type="text/css" rel="stylesheet">
<link href="css/uportal3.css" media="screen" type="text/css" rel="stylesheet">
<script type="text/javascript" src='/${requestScope.contextPath}/scripts/jquery-1.4.2.js' ></script>

<script type="text/javascript">
/**
 * Get the HTML form.
 * @param namespace
 * @param frmName
 * @return
 */
function getForm(namespace, frmName) {
    return document.forms[namespace + frmName];
}

/**
 * Submit the form.
 * @param namespace
 * @param frmName
 * @param eventId
 * @return
 */
function submitAction(namespace, frmName, eventId, dictId) {
    var frm = getForm(namespace, frmName);
    frm.eventId.value = eventId;
    frm.dictId.value = dictId;
    frm.submit();
}
</script>
<hr>
<h2>Welcome,${username}</h2>
<form name="<portlet:namespace/>ManagerHome" action="<portlet:actionURL/>" method="POST">
    <input name="eventId" type="hidden" />
    <input name="screenId" type="hidden" value="managerhome"/>
    <input name="dictId" type="hidden"/>
    <table border="0" width="100%" id="table1" cellspacing="0" cellpadding="0" bgcolor="#66CCFF" height="22">
        <tr>
            <td>
                <p align="right">
				<input type="button" value="Home Page" onclick='submitAction("<portlet:namespace/>", "ManagerHome", "home");' >
				<input type="button" value="Change Password" onclick='submitAction("<portlet:namespace/>", "ManagerHome", "changepass");'>
                <input type="button" value="Logout" onclick='submitAction("<portlet:namespace/>", "ManagerHome", "logout");'> 
			</td>
        </tr>
    </table>
    <br/>
    <table border="1">
	<tbody>
		<tr>
            <td>APPROVE MANAGEMENT</td>
        </tr>
        <tr>
            <td align="center">Dictionary</td>
            <td align="center">Details</td>
            <td align="center">Tasks</td>
        </tr>
        <c:forEach var="item" items="${result.approverManager}">
			<tr>
				<td align="center">${item.dictName }</td>
				<td>
					<table>
					<tbody>
						<tr>
							<td align="center">Review Managers:${item.reviewer }</td>
						</tr>
						<tr>
							<td align="center">New Words:${item.countnewword }</td>
						</tr>
						<tr>
						</tr>
					</tbody>
					</table>
				</td>
				<td>
					<table>
					<tbody>
						<tr>
							<td>
								<input value="Reviewer details" onclick='submitAction("<portlet:namespace/>", "ManagerHome", "reviewerdetail", "${item.m_dictID }");' type="button">
							</td>
						</tr>
						<tr>
							<td>
								<input value="Check New Words" onclick='submitAction("<portlet:namespace/>", "ManagerHome", "checkapprvword", "${item.m_dictID }");' type="button">
							</td>
						</tr>
					</tbody>
					</table>
				</td>
			</tr>
        </c:forEach>
        <tr>
            <td>REVIEW MANAGEMENT</td>
        </tr>
        <tr>
            <td align="center">Dictionary</td>
            <td align="center">Details</td>
            <td align="center">Tasks</td>
        </tr>
        <c:forEach var="item" items="${result.reviewerManager}">
			<tr>
				<td align="center">${item.dictName }</td>
				<td>    
					<table>
					<tbody>
						<tr>
							<td align="center">New Words:${item.countnewword }</td>
						</tr>
					</tbody>
					</table>
				</td>
				<td>
					<table>
					<tbody>
						<tr>
							<td>
								<input value="Check New Words" onclick='submitAction("<portlet:namespace/>", "ManagerHome", "checkrevieword","${item.m_dictID }");' type="button">
							</td>
						</tr>
					</tbody>
					</table>
				</td>
			</tr>
        </c:forEach>
    </tbody>
	</table>
</form>